"""基于磁盘文件的高性能跨线程/进程全局的缓存"""

from diskcache import FanoutCache as Cache_


class Cache:
    # 项目内类redis的高速缓存，使用方式：
    #   cache.set('key', 'value', expire=60) # 60秒过期
    HOSTING_CACHE: object = Cache_(
        "/tmp/FisherMan/hosting_cache", size_limit=1000_0000, timeout=1
    )
    HOSTING_JAVA_PID_CACHE: object = Cache_(
        "/tmp/FisherMan/hosting_java_pid_cache", size_limit=1000_0000, timeout=1
    )
    SSE_CACHE: object = Cache_(
        "/tmp/FisherMan/sse_cache", size_limit=1000_0000, timeout=1
    )
    LOG_CACHE: object = Cache_(
        "/tmp/FisherMan/log_cache", size_limit=1000_0000, timeout=1
    )
